using System;
using System.Collections.Generic;
using System.Text;
using SlimDX.Direct3D9;
using SlimDX;
using System.Runtime.InteropServices;

namespace Barrage.Global.Vertex
{
    /// <summary>
    /// Vertex format with only color information
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct VertexColorOnly
    {
        /// <summary>
        /// Vertex color
        /// </summary>
        public Color4 Color;


        /// <summary>
        /// Size in bytes of the structure
        /// </summary>
        public static int SizeBytes
        {
            get { return Marshal.SizeOf(typeof(VertexColorOnly)); }
        }

        /// <summary>
        /// Array of VertexElements holding this vertex format's declaration
        /// </summary>
        public static VertexElement[] Elements = new VertexElement[]{
                            new VertexElement(0,0,DeclarationType.Float4,DeclarationMethod.Default,DeclarationUsage.Color,0),                            
                            VertexElement.VertexDeclarationEnd
                        };

        /// <summary>
        /// VertexFormat declaration
        /// </summary>
        public static VertexFormat Format
        {
            get { return VertexFormat.Diffuse; }
        }

        /// <summary>
        /// Constructor. Inits values
        /// </summary>
        /// <param name="color">Vertex color</param>
        public VertexColorOnly(Color4 color)
        {
            this.Color = color;
        }
    }
}
